# import re

# text = '博主讲的实在是太好了，通俗易懂，已三连，求课件，我的邮箱是 1165872335@qq.com 或者是xiaohu2023666@pronton.com谢谢博主 手机微信号也可以17354074069'
#
# # res1 = re.findall(r'\w+@\w+\.\w+', text, re.ASCII)
# res1 = re.findall(r'\d{11}', text)
# print(res1)

# text = '大大撒旦问起我xiaohu dwdwqe请问请问xiaohu666,请问xiaohuABC,我xiaohq'
# res1 = re.findall('xiaohu', text)
# print(res1)

# import re
#
# text = '大大撒旦问起我xiaohu dwdwqe请问请问xiaohu666,请问xiaohuABC,我xiaohq,请问xiaohqu'
# res1 = re.findall(r'xiaoh[uq]', text)
# print(res1)  # ['xiaohu', 'xiaohu', 'xiaohu']

# import re

# text = '大大撒旦问起我xiaohu dwdwqe请问请问xiaohu666,请问xiaohuABC,我xiaohq,请问xiaohqu'
# res1 = re.findall(r'xiaohu[0-9][0-9][0-9]', text)
# print(res1)  # ['xiaohu6']

# import re
#
# text = '大大撒旦问起我xiaohuqwe dwdwqe请问请问xiaohu666,请问xiaohuABC,我xiaohq,请问xiaohqu'
# res1 = re.findall(r'xiaohu[a-z]', text)
# print(res1)  # []

# import re
#
# text = '大大撒旦问起我xiaohuq dwdwqe请问请问xiaohu666,请问xiaohuABC,我xiaohq,请问xiaohqu'
# res1 = re.findall(r'xiaohu[A-z]', text)
# print(res1)  # []

# import re
#
# text = '大大 xiao.hu 撒旦问起我xiao@huw dwdwqe请问请问xiao hu666,请问xiaohuABC,我xiaohq,请问xiaohqu'
# # raw string
# # 183  153  173
# res1 = re.findall(r'xiao\.hu', text)
# print(res1)  # ['xiao汉hu', 'xiao@hu', 'xiao hu']

# import re
# text = '博主讲的实在是太好了，通俗易懂，已三连，求课件，我的邮箱是 1165872335@qq.com 或者是xiaohu2023666@pronton.com谢谢博主 手xiaohu2机微信号也可以17354074069'
#
# # res1 = re.findall(r'\w+@\w+\.\w+', text, re.ASCII)
# res1 = re.findall(r'xiaohu\d+', text)
# print(res1)

# import re
#
# text = '我的身份证号是：32012320001231987X，还有一个人的身份证是320123200110059879，手机号是17332012325'  # ['2000','2001']
# res = re.findall(r'(320123(\d{4})(\w{2})(\w{2})\w{3}[\dX])', text)
# print(res)  # [('32012320001231987X', '2000', '12', '31'), ('320123200110059879', '2001', '10', '05')]

# import re
#
# text = '博主讲的实在是太1165872335@数加$.com好了，通俗易懂，已三连，求课件，我的邮箱是 1165872335@qq.com 或' \
#        '者是xiaohu2023666@pronton.com谢谢博主 手xiaohu2机微信号也可以17354074069'
# # res = re.findall(r'([a-z0-9]+@(数加\$|qq|pronton)\.com)',text)
# res = re.findall(r'^1\d+@\w+\.com$', text)
# print(res)  # [('博主讲的实在是太1165872335@数加$.com', '数加$'), ('1165872335@qq.com', 'qq'), ('或者是xiaohu2023666@pronton.com', 'pronton')]
#
# # text = '1165872335@qq.com'
# # res = re.findall(r'^1\d+@\w+\.com$', text)
# # print(res)


# import re
#
# text = '1165872335@qq.com好了，通俗易懂，已三连，求课件，我的邮箱是 1165872335@qq.com 或' \
#        '者是xiaohu2023666@pronton.com谢谢博主 手xiaohu2机微信号也可以17354074069'
#
# # res = re.search(r'[a-z0-9]+@\w+\.\w+', text, re.ASCII)
# # print(res.group())
#
# # res = re.match(r'[a-z0-9]+@\w+\.\w+', text, re.ASCII)
# # print(res.group())
#
# res = re.split(r'@qq|pronton',text)  # ['1165872335', '.com好了，通俗易懂，已三连，求课件，我的邮箱是 1165872335', '.com 或者是xiaohu2023666@', '.com谢谢博主 手xiaohu2机微信号也可以17354074069']
# print(res)

# re.fullmatch() # 匹配整个字符串是否符合正则表达式
# re.finditer()  # 返回的是一个可以迭代的对象

import re

text = '1165872335@qq.com好了，通俗易懂，已三连，求课件，我的邮箱是 1165872335@qq.com 或' \
       '者是xiaohu2023666@pronton.com谢谢博主 手xiaohu2机微信号也可以17354074069'
# res = re.findall(r'([a-z0-9]+@(数加\$|qq|pronton)\.com)',text)
# res = re.findall(r'1\d+@\w+\.com', text)
# print(res)  # [('博主讲的实在是太1165872335@数加$.com', '数加$'), ('1165872335@qq.com', 'qq'), ('或者是xiaohu2023666@pronton.com', 'pronton')]
#
#
# res1 = re.findall(r'1\d+@\w+\.com', text)
# print(res1)

# 将正则表达式编译成一个对象
re_obj = re.compile(r'1\d+@\w+\.com')
res = re_obj.findall(text)
print(res)

text2 = '通俗易懂，已三连，求课件，我的邮箱是 1165872335@qq.com 或' \
       '者是xiaohu2023666@pronton.com谢谢博主 手xiaohu2机微信号也可以17354074069'

res2 = re_obj.findall(text2)
print(res2)